From: Giovanni Campagna Date: Wed, 3 Oct 2012 21:38:35 +0000 (+0200) Subject: NetworkMenu: don't queue menu updates for destroyed devices X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5057 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d583c48992e1360c789c51da752cc84622b9736c;p=gnome-shell.git NetworkMenu: don't queue menu updates for destroyed devices It will cause an exception as the work ID is now invalid, and may block new devices from appearing for example when NM is restarted. https://bugzilla.gnome.org/show_bug.cgi?id=684279 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 71e3a735b..4bc2335a0 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -357,6 +357,12 @@ const NMDevice = new Lang.Class({ this._firmwareChangedId = 0; } + if (this._deferredWorkId) { + // Just clear out, the actual removal is handled when the + // actor is destroyed + this._deferredWorkId = 0; + } + this._clearSection(); if (this.statusItem) this.statusItem.destroy(); @@ -490,8 +496,10 @@ const NMDevice = new Lang.Class({ }, _queueCreateSection: function() { - this._clearSection(); - Main.queueDeferredWork(this._deferredWorkId); + if (this._deferredWorkId) { + this._clearSection(); + Main.queueDeferredWork(this._deferredWorkId); + } }, _clearSection: function() {